import { HttpReqMehod } from "../../enums/httpEnum";
import axios from "@/utils/request";
import { Login } from "../interface";
const BASE_URL = "/system";

/**
 * 登录
 * @param data
 * @returns 字符串token
 */
export const doLogin = <T>(data: Login.LoginParams) => {
  return axios<T>({
    url: `${BASE_URL}/login`,
    method: HttpReqMehod.POST,
    data,
  });
};

/**
 * 注册用户
 * @param data
 * @returns 字符串token
 */
export const doRegister = <T>(data: Login.RegisterParams) => {
  return axios<T>({
    url: `${BASE_URL}/register`,
    method: HttpReqMehod.POST,
    data,
  });
};
